import request from '@/config/axios'

// MQTT报表分类 VO
export interface DeviceReportVO {
  id?: number // 报表ID
  deviceId: number // 设备ID
  reportName: string // 名称
  dataType: string // 数据类型
  reportType: string // 报表类型
  mqttNum: string // 数量
}

// MQTT报表分类 API
export const DeviceReportApi = {
  // 查询MQTT报表分类分页
  getDeviceReportPage: async (params: any) => {
    return await request.get({ url: `/mqtt/device-report/page`, params })
  },

  // 查询MQTT报表分类详情
  getDeviceReport: async (id: number) => {
    return await request.get({ url: `/mqtt/device-report/get?id=` + id })
  },

  // 新增MQTT报表分类
  createDeviceReport: async (data: DeviceReportVO) => {
    return await request.post({ url: `/mqtt/device-report/create`, data })
  },

  // 修改MQTT报表分类
  updateDeviceReport: async (data: DeviceReportVO) => {
    return await request.put({ url: `/mqtt/device-report/update`, data })
  },

  // 删除MQTT报表分类
  deleteDeviceReport: async (id: number) => {
    return await request.delete({ url: `/mqtt/device-report/delete?id=` + id })
  },

  // 导出MQTT报表分类 Excel
  exportDeviceReport: async (params) => {
    return await request.download({ url: `/mqtt/device-report/export-excel`, params })
  }
}
